package com;

import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 数据流 为了解决操作系统间数据存储问题
 * 
 * @author lenovo
 * @date 2020年7月21日
 */
public class IO_12_DataOutputStream {

	public static void main(String[] args) throws IOException {
		DataOutputStream dos = new DataOutputStream(new FileOutputStream("./src/com/fos_tmp.txt"));
		byte b = 10;
		short s = 11;
		int i = 12;
		long l = 1000;
		double d = 2.3;
		float f = 3.2F;
		boolean flag = false;
		char c = 'a';
		dos.writeByte(b);
		dos.writeShort(s);
		dos.writeInt(i);
		dos.writeLong(l);
		dos.writeDouble(d);
		dos.writeFloat(f);
		dos.writeBoolean(flag);
		dos.writeChar(c);
		dos.flush();
		dos.writeUTF("你吃了吗");
		dos.close();
	}

}
